﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace Project_mfa
{
    public partial class MasterPage1 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Page.User.Identity.IsAuthenticated)
            {
                if (HttpContext.Current.User.IsInRole("Admin"))
                {
                    HyperLinkLogin.NavigateUrl = "Admin.aspx";
                    HyperLinkLogin.Text = "Admin";
                }
                else if (HttpContext.Current.User.IsInRole("UserSchrijf"))
                {
                    HyperLinkLogin.NavigateUrl = "User.aspx";
                    HyperLinkLogin.Text = "Manage";
                }
                else
                {
                    HyperLinkLogin.NavigateUrl = "LogIn.aspx";
                    HyperLinkLogin.Text = "login";
                }
            }
            else
            {
                HyperLinkLogin.NavigateUrl = "LogIn.aspx";
                HyperLinkLogin.Text = "login";
            }

        }
    }
}